<%@ page contentType="text/html; charset=UTF-8"%>
<%@page import="com.sinodata.bsm.center.purview.FunctionConstants"%>
<%@page import="com.sinodata.bsm.center.purview.UserFunctionValidate"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <title>config-frame</title>
<%boolean sysManager = UserFunctionValidate.sysFunctionValidate(FunctionConstants.SYSTEM_MANAGER);%>
<%boolean isGuestRole = UserFunctionValidate.isGuestRole(); %>
	  <script type="text/javascript"
		src="${pageContext.request.contextPath}/js/jquery/iframe.js">
	</script>
    
    <%@ include file="../include/common.jsp"%>
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/style/default/bsm/res_view_menu.css"  />

    <%@ include file="../include/tree.jsp"%>
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery/iframe.js"></script>
    <script type="text/javascript">
    function setContent() {
		var windowHeight = getWindowHeight();
		var contentElement = document.getElementById('contentFrame');
    	contentElement.style.height = (windowHeight) + 'px';
    	 $("#tree_div").css("height",windowHeight-20);
	}
	<%if(sysManager){%>
var zNodes =[
			{ id:10, pId:0, name:"采集协议", open:true},
			{ id:1001, pId:10, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"主机配置",url:"${pageContext.request.contextPath}/config/host-config!common.action",target:"contentFrame"},
			{ id:1006, pId:10, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"WMI配置",url:"${pageContext.request.contextPath}/config/wmi-config!common.action",target:"contentFrame"},
			{ id:1002, pId:10, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"数据库配置",url:"${pageContext.request.contextPath}/config/db-config!common.action",target:"contentFrame"},
			{ id:1003, pId:10, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"JMX配置",url:"${pageContext.request.contextPath}/config/jmx-config!common.action",target:"contentFrame"},
			{ id:1004, pId:10, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"HTTP配置",url:"${pageContext.request.contextPath}/config/http-config!common.action",target:"contentFrame"},
			{ id:1005, pId:10, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"SNMP配置",url:"${pageContext.request.contextPath}/config/snmp-config!common.action",target:"contentFrame"},
			//{ id:13, pId:0, name:"定义资源查询",url:"${pageContext.request.contextPath}/config/resource-dimension-config!common.action",target:"contentFrame"},
			{ id:20, pId:0, name:"系统定制", open:true},
			{ id:2001, pId:20, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"资源视图",url:"${pageContext.request.contextPath}/config/resource-view-config!common.action",target:"contentFrame"},
			{ id:2002, pId:20, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"类别性能图",url:"${pageContext.request.contextPath}/performance/real-time-view!custom.action",target:"contentFrame"},
			{ id:2003, pId:20, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"资源性能图",url:"${pageContext.request.contextPath}/performance/real-time-view!freeCustom.action",target:"contentFrame"},
			{ id:2004, pId:20, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"拓扑图TIP",url:"${pageContext.request.contextPath}/performance/real-time-view!tooltip.action",target:"contentFrame"},
			{ id:2005, pId:20, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"默认事件规则",url:"${pageContext.request.contextPath}/event/default-event-rule!common.action",target:"contentFrame"},
			//{ id:2006, pId:20, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"资源维度管理",url:"${pageContext.request.contextPath}/config/dimension-type-config!common.action",target:"contentFrame"},
			//{ id:2007, pId:20, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"系统参数设置",url:"${pageContext.request.contextPath}/config/config!viewSystemParameter.action",target:"contentFrame"},
			{ id:2008, pId:20, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"首页拓扑设置",url:"${pageContext.request.contextPath}/config/topu-config!common.action",target:"contentFrame"},
			{ id:40, pId:0, name:"系统监视", open:true},
			{ id:4001, pId:40, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"中心监视",url:"${pageContext.request.contextPath}/selfmainten/bsm!common.action",target:"contentFrame"},
			{ id:4002, pId:40, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"采集器监视",url:"${pageContext.request.contextPath}/selfmainten/probe!common.action",target:"contentFrame"},
			{ id:4003, pId:40, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"MQ队列",url:"${pageContext.request.contextPath}/selfmainten/bsm!mq.action",target:"contentFrame"},
			{ id:4004, pId:40, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"失效事件规则",url:"${pageContext.request.contextPath}/selfmainten/event!common.action",target:"contentFrame"},
			{ id:4006, pId:40, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"指标采集检查",url:"${pageContext.request.contextPath}/selfmainten/bsm!property.action",target:"contentFrame"},
			{ id:4007, pId:40, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"网络模板维护",url:"${pageContext.request.contextPath}/selfmainten/net-work!common.action",target:"contentFrame"},
			{ id:4008, pId:40, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"数据库表查看",url:"${pageContext.request.contextPath}/selfmainten/bsm!table.action",target:"contentFrame"},
			{ id:4009, pId:40, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"存储过程查看",url:"${pageContext.request.contextPath}/selfmainten/bsm!procedure.action",target:"contentFrame"},
			{ id:4010, pId:40, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"JOB查看",url:"${pageContext.request.contextPath}/selfmainten/bsm!job.action",target:"contentFrame"},
			{ id:50, pId:0, name:"系统工具", open:true},
			{ id:5001, pId:50, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"用户中心同步",url:"${pageContext.request.contextPath}/config/user-info.action",target:"contentFrame"},
			{ id:5002, pId:50, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"SSH客户端",url:"${pageContext.request.contextPath}/selfmainten/tool!ssh2.action",target:"contentFrame"},
			{ id:5004, pId:50, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"Telnet客户端",url:"${pageContext.request.contextPath}/selfmainten/tool!telnet.action",target:"contentFrame"},
			{ id:5003, pId:50, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"通知测试",url:"${pageContext.request.contextPath}/selfmainten/tool!toNotify.action",target:"contentFrame"},
			{ id:5005, pId:50, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"SNMP测试",url:"${pageContext.request.contextPath}/selfmainten/tool!snmp.action",target:"contentFrame"}
	        //{ id:5005, pId:50, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"日志查看",url:"../jsp/selfmainten/tool-viewlog.jsp",target:"contentFrame"}
			
			];
			<%}else if(isGuestRole){%>
			var zNodes =[
			 			{ id:10, pId:0, name:"采集协议", open:true},
			 			{ id:1001, pId:10, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"主机配置",url:"${pageContext.request.contextPath}/config/host-config!common.action",target:"contentFrame"},
			 			{ id:1006, pId:10, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"WMI配置",url:"${pageContext.request.contextPath}/config/wmi-config!common.action",target:"contentFrame"},
			 			{ id:1002, pId:10, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"数据库配置",url:"${pageContext.request.contextPath}/config/db-config!common.action",target:"contentFrame"},
			 			{ id:1003, pId:10, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"JMX配置",url:"${pageContext.request.contextPath}/config/jmx-config!common.action",target:"contentFrame"},
			 			{ id:1004, pId:10, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"HTTP配置",url:"${pageContext.request.contextPath}/config/http-config!common.action",target:"contentFrame"},
			 			{ id:1005, pId:10, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"SNMP配置",url:"${pageContext.request.contextPath}/config/snmp-config!common.action",target:"contentFrame"},
			 			//{ id:13, pId:0, name:"定义资源查询",url:"${pageContext.request.contextPath}/config/resource-dimension-config!common.action",target:"contentFrame"},
			 			//{ id:30, pId:0, name:"个性设置", open:true},
			 			//{ id:3001, pId:30, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"首页拓扑设置",url:"${pageContext.request.contextPath}/config/topu-config!common.action",target:"contentFrame"},
			 			{ id:40, pId:0, name:"系统监视", open:true},
			 			{ id:4001, pId:40, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"中心监视",url:"${pageContext.request.contextPath}/selfmainten/bsm!common.action",target:"contentFrame"},
			 			{ id:4002, pId:40, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"采集器监视",url:"${pageContext.request.contextPath}/selfmainten/probe!common.action",target:"contentFrame"},
			 			{ id:4003, pId:40, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"失效事件规则",url:"${pageContext.request.contextPath}/selfmainten/event!common.action",target:"contentFrame"},
			 			{ id:4006, pId:40, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"指标采集检查",url:"${pageContext.request.contextPath}/selfmainten/bsm!property.action",target:"contentFrame"},
			 			{ id:50, pId:0, name:"系统工具", open:true},
			 			{ id:5001, pId:50, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"用户中心同步",url:"${pageContext.request.contextPath}/config/user-info.action",target:"contentFrame"},
			 			{ id:5002, pId:50, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"SSH客户端",url:"${pageContext.request.contextPath}/selfmainten/tool!ssh2.action",target:"contentFrame"},
						{ id:5004, pId:50, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"Telnet客户端",url:"${pageContext.request.contextPath}/selfmainten/tool!telnet.action",target:"contentFrame"},
			 			{ id:5003, pId:50, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"通知测试",url:"${pageContext.request.contextPath}/selfmainten/tool!toNotify.action",target:"contentFrame"}
			 			];			    
			<%}else{%>
					var zNodes =[
					{ id:2001, pId:0, icon:"${pageContext.request.contextPath}/style/default/tree/img/node.gif",name:"首页拓扑设置",url:"${pageContext.request.contextPath}/config/topu-config!common.action",target:"contentFrame"}
					];
			<%}%>

	var setting = {
			view: {
				showLine: false
			},
			data: {
				simpleData: {
					enable: true
				}
			}
		};
		$(document).ready(function(){
						outerLayout = $('body').layout({ 
						center__paneSelector:	    ".outer-center" 
						,	west__paneSelector:		".outer-west" 
						,	west__size:				190 
						,	spacing_open:			8 // ALL panes
						,	spacing_closed:			8 // ALL panes
						,   togglerTip_open:'关闭'
						,   togglerTip_closed: "显示"
						,   slidable:false
			
			}); 
  				$.fn.zTree.init($("#treeDemo"),setting,zNodes);
  				zTree_Menu = $.fn.zTree.getZTreeObj("treeDemo");
  				curMenu = zTree_Menu.getNodes()[0].children[0];
  				zTree_Menu.selectNode(curMenu);

		});
    </script>
    <style>
	    .ui-layout-resizer{
	    	background:none;
	    }
    </style>

</head>
  <body>
  
	<div class="outer-west" >
		<div  class="tree_navigat title-no-dowm">
			<a  class="tree_caption"  hidefocus="true" >
				<%if(sysManager){%>
			系统维护功能导航
			<%}else{ %>
			个性设置
			<%} %>
			</a>
		</div>
		<div id = "tree_div">
			<ul id="treeDemo" class="ztree"></ul>
		</div>
	</div>
		<div class="outer-center" >
		<%if(sysManager || isGuestRole){%>
	  		<iframe id="contentFrame" name="contentFrame" src="/bsm/config/host-config!common.action"  frameborder="0" width="100%" height="300px;" ></iframe>
	    <%}else{ %>
	        <iframe id="contentFrame" name="contentFrame" src="/bsm/config/topu-config!common.action"  frameborder="0" width="100%" height="300px;" ></iframe>
	    <%} %>
	</div>
 </body>
</html>